/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Telas;

import classes.GravaHorario;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

/**
 *
 * @author Marcello
 */
public class TelaAdicionarHorario extends javax.swing.JInternalFrame {

    /**
     * Creates new form TelaAdicionarHorario
     */
    public TelaAdicionarHorario() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        jComboBoxHorario = new javax.swing.JComboBox();
        jButtonConfirma = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jComboBoxDisciplinas = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jComboBoxDia = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jComboBoxLocal = new javax.swing.JComboBox();
        jComboBoxSala = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();

        setPreferredSize(new java.awt.Dimension(641, 325));

        jLabel2.setText("Dia:");

        jComboBoxHorario.addItem("18:50h-20:20h");
        jComboBoxHorario.addItem("20:30h-22:00h");
        jComboBoxHorario.addItem("14:00h-15:50h");
        jComboBoxHorario.addItem("16:00h-17:50h");
        jComboBoxHorario.addItem("07:10h-08:50h");
        jComboBoxHorario.addItem("09:10h-10:50h");
        jComboBoxHorario.addItem("10:50h-12:30h");
        jComboBoxHorario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxHorarioActionPerformed(evt);
            }
        });

        jButtonConfirma.setText("Confirma");
        jButtonConfirma.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonConfirmaActionPerformed(evt);
            }
        });

        jLabel3.setText("Horario:");

        jLabel4.setText("Disciplina:");

        jComboBoxDisciplinas.addItem("Estrutura de Dados");
        jComboBoxDisciplinas.addItem("Sistemas Operacionais");
        jComboBoxDisciplinas.addItem("Matemática Financeira");
        jComboBoxDisciplinas.addItem("Programação orientada à objetos");
        jComboBoxDisciplinas.addItem("Arquitetura de computadores");
        jComboBoxDisciplinas.addItem("introdução à programação");
        jComboBoxDisciplinas.addItem("Introdução à sistemas de informação");
        jComboBoxDisciplinas.addItem("Lógica");
        jComboBoxDisciplinas.addItem("Teoria geral da administração");
        jComboBoxDisciplinas.addItem("Engenharia de requisitos");
        jComboBoxDisciplinas.addItem("Engenharia de software");
        jComboBoxDisciplinas.addItem("Fundamentos de contabilidade");
        jComboBoxDisciplinas.addItem("Matemática discreta");
        jComboBoxDisciplinas.addItem("Programação imperativa");
        jComboBoxDisciplinas.addItem("Banco de dados 1");
        jComboBoxDisciplinas.addItem("Programação para web");
        jComboBoxDisciplinas.addItem("planejamento estratégico");
        jComboBoxDisciplinas.addItem("Ética, computador e Sociedade");
        jComboBoxDisciplinas.addItem("Projeto do software");
        jComboBoxDisciplinas.addItem("Núcleo livre");
        jComboBoxDisciplinas.addItem("Banco de dados 2");
        jComboBoxDisciplinas.addItem("Construção de software");
        jComboBoxDisciplinas.addItem("Rede de computadores");
        jComboBoxDisciplinas.addItem("Qualidade de software");
        jComboBoxDisciplinas.addItem("Gestão de projetos 1");
        jComboBoxDisciplinas.addItem("Aplicações distribuidas");
        jComboBoxDisciplinas.addItem("Auditoria de sistemas");
        jComboBoxDisciplinas.addItem("Gestão em tecnologia da informação");
        jComboBoxDisciplinas.addItem("Comunicação empresarial");
        jComboBoxDisciplinas.addItem("Gerência de projetos 2");
        jComboBoxDisciplinas.addItem("Arquitetura de software");
        jComboBoxDisciplinas.addItem("Segurança em sistemas de informação");
        jComboBoxDisciplinas.addItem("Empreendedorismo");
        jComboBoxDisciplinas.addItem("PCF1");
        jComboBoxDisciplinas.addItem("Interação homem-computador");
        jComboBoxDisciplinas.addItem("Direito");
        jComboBoxDisciplinas.addItem("PFC2");
        jComboBoxDisciplinas.addItem("Manutenção de software");
        jComboBoxDisciplinas.addItem("Gestão de pessoas");
        jComboBoxDisciplinas.addItem("Tópicos 2");
        jComboBoxDisciplinas.addItem("Tópicos 3 ou libras");
        jComboBoxDisciplinas.addItem("Tópicos 1");

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel1.setText("Adicionar Horario");

        jComboBoxDia.addItem("Segunda");
        jComboBoxDia.addItem("Terça");
        jComboBoxDia.addItem("Quarta");
        jComboBoxDia.addItem("Quinta");
        jComboBoxDia.addItem("Sexta");
        jComboBoxDia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxDiaActionPerformed(evt);
            }
        });

        jLabel5.setText("Local de aula");

        jComboBoxLocal.addItem("CAA");
        jComboBoxLocal.addItem("CAB");
        jComboBoxLocal.addItem("CAC");
        jComboBoxLocal.addItem("INF");

        jComboBoxSala.addItem("100");
        jComboBoxSala.addItem("101");
        jComboBoxSala.addItem("102");
        jComboBoxSala.addItem("103");
        jComboBoxSala.addItem("104");
        jComboBoxSala.addItem("105");
        jComboBoxSala.addItem("106");
        jComboBoxSala.addItem("107");
        jComboBoxSala.addItem("108");
        jComboBoxSala.addItem("109");
        jComboBoxSala.addItem("110");
        jComboBoxSala.addItem("111");
        jComboBoxSala.addItem("112");
        jComboBoxSala.addItem("113");
        jComboBoxSala.addItem("114");
        jComboBoxSala.addItem("115");
        jComboBoxSala.addItem("116");
        jComboBoxSala.addItem("117");
        jComboBoxSala.addItem("118");
        jComboBoxSala.addItem("119");
        jComboBoxSala.addItem("200");
        jComboBoxSala.addItem("201");
        jComboBoxSala.addItem("202");
        jComboBoxSala.addItem("203");
        jComboBoxSala.addItem("204");
        jComboBoxSala.addItem("205");
        jComboBoxSala.addItem("206");
        jComboBoxSala.addItem("207");
        jComboBoxSala.addItem("208");
        jComboBoxSala.addItem("209");
        jComboBoxSala.addItem("300");
        jComboBoxSala.addItem("301");
        jComboBoxSala.addItem("302");
        jComboBoxSala.addItem("303");
        jComboBoxSala.addItem("304");
        jComboBoxSala.addItem("305");
        jComboBoxSala.addItem("306");
        jComboBoxSala.addItem("307");
        jComboBoxSala.addItem("308");
        jComboBoxSala.addItem("309");

        jLabel6.setText("Sala");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addGap(246, 246, 246))
            .addGroup(layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jComboBoxSala, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBoxLocal, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBoxDisciplinas, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(jButtonConfirma))
                            .addComponent(jComboBoxHorario, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBoxDia, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addGap(21, 21, 21))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxDia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxHorario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxDisciplinas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxLocal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxSala, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12)
                .addComponent(jButtonConfirma)
                .addGap(21, 21, 21))
        );

        setBounds(0, 0, 648, 398);
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonConfirmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonConfirmaActionPerformed
        try {
            GravaHorario.gravarHorario(jComboBoxDia.getSelectedItem().toString(),jComboBoxHorario.getSelectedItem().toString(), jComboBoxDisciplinas.getSelectedItem().toString(), jComboBoxLocal.getSelectedItem().toString(), jComboBoxSala.getSelectedItem().toString());
            JOptionPane.showMessageDialog(null, "Horário gravados\n");
        } catch (IOException ex) {
            Logger.getLogger(TelaAdicionarHorario.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        /*//String disci = jComboBoxDia.getSelectedItem().toString();
        //String horario = String.valueOf(jComboBoxHorario);
        //String dia = String.valueOf(jComboBoxDia);
        if(jComboBoxDia.getSelectedItem()=="Segunda"){// pega oqe foi escolhido no dia
            System.out.println("Entrei Dia"); // so pra vc ver q entro no if
            if(jComboBoxHorario.getSelectedItem()=="18:50h-20:20h"){ // se for igual o horario digitado
                System.out.println("Entrei Horario");
                JLabel jLabelDisciplina = new javax.swing.JLabel();
                jLabelDisciplina.add(jComboBoxDia);
                jLabelDisciplina.setVisible(true);
            }
        } 
                */
        this.dispose();
    }//GEN-LAST:event_jButtonConfirmaActionPerformed

    private void jComboBoxDiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxDiaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBoxDiaActionPerformed

    private void jComboBoxHorarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxHorarioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBoxHorarioActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonConfirma;
    private javax.swing.JComboBox jComboBoxDia;
    private javax.swing.JComboBox jComboBoxDisciplinas;
    private javax.swing.JComboBox jComboBoxHorario;
    private javax.swing.JComboBox jComboBoxLocal;
    private javax.swing.JComboBox jComboBoxSala;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    // End of variables declaration//GEN-END:variables
}
